Skip to content

fix(Makefile): prevent NUM_VALIDATORS from evaluating to two tokens - #339

Open
Ocheretovich wants to merge 1 commit into
circlefin:mainfrom
Ocheretovich:patch-1
Open

fix(Makefile): prevent NUM_VALIDATORS from evaluating to two tokens#339
Ocheretovich wants to merge 1 commit into
circlefin:mainfrom
Ocheretovich:patch-1

Conversation

@Ocheretovich

@Ocheretovich Ocheretovich commented Sep 4, 2026

Copy link
Copy Markdown

Fixed a bug in NUM_VALIDATORS: when the manifest had no [nodes.validator...] entries, grep -c returned 0 but exited with status 1, which triggered the || echo 5 fallback resulting in the variable evaluating to "0 5" instead of a single number. The check is now explicit: fall back to 5 only when grep's count is missing or zero, otherwise use the actual count.

I tested the old and new logic against three cases missing manifest, manifest with zero validators, and manifest with 3 validators. The first and third cases behave identically either way, but the middle one exposes the bug: the old logic returned "0\n5" (two values instead of one) when the manifest existed but had no validator entries, while the fix correctly returns 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant